package com.vf.editor.mvc.scene;

import java.util.LinkedList;
import java.util.List;

import com.vf.editor.common.model.resources.SceneLayer;
import com.vf.editor.mvc.scene.layer.SceneLayerService;

public class SceneService{
	
	private final SceneLayerService sceneLayerService=new SceneLayerService();

	public List<SceneLayer> getResources(String sceneId) {
		List<SceneLayer> objects=new LinkedList<SceneLayer>();
		List<SceneLayer> layers=SceneLayer.dao.find("SELECT * FROM "+SceneLayer.TABLE_NAME+" a WHERE a.SCENEID=? AND a.show=?  and a.TYPE!='-1' order by a.sort asc  ",sceneId,"1");
		SceneLayer thing;
		for(SceneLayer layer:layers) {
			thing=sceneLayerService.getThing(layer);
			if(thing!=null) {
				objects.add(thing);
			}
		}
		return objects;
	}
}
